package com.baseweb.webadmin.core.model.dao;

import com.baseweb.webadmin.core.model.bvo.UserRoleBvo;
import com.baseweb.webadmin.core.model.pojo.*;

import java.util.List;
import java.util.Map;

public interface ContentDao {
    public User selectUserByUserName(String username);

    public List<User> selectUsers(String username);

    public List<UserRoleBvo> selectUsersByPage(Map map);

    public Integer selectUsersByNameRows(Map map);

    /**
     * 根据邮箱在user表中判断该邮箱
     * 是否已经被使用
     *
     * @param email
     * @return
     */
    public List<User> selectUserByEmail(String email);

    public List<User> selectUserListByPage(Integer id, String username, Integer start, Integer offset);

//    public Integer selectUserListCount(Integer id, String username);


    public Integer insertFeedback(ByUserFeedback byUserFeedback);
    public ByUserFeedback findFeedback(Integer id);
    public List<ByUserFeedback> selectFeedbackListByPage(Integer userId, Integer start, Integer offset);
    public Integer selectFeedbackListCount(Integer userId);

    public List<ByUserFeedback> selectFeedbackListByPage1(ByUserFeedback feedback, Integer start, Integer offset);
    public Integer selectFeedbackListCount1(ByUserFeedback feedback);

    public Integer insertLevel(ByLevel byLevel);
    public ByLevel findLevel(Integer id);
    public List<ByLevel> selectLevelListByPage(Integer start, Integer offset);
    public Integer selectLevelListCount();

    public Integer insertDict(ByDict byDict);
    public ByDict findDict(Integer id);
    public List<ByDict> selectDictListByPage(Integer dictType, Integer start, Integer offset);
    public Integer selectDictListCount(Integer dictType);

    public Integer insertChannel(ByChannel byChannel);
    public ByChannel findChannel(Integer id);
    public List<ByChannel> selectChannelListByPage(Integer positionId, Integer parentId, Integer status, Integer start, Integer offset);
    public List<ByChannel> selectChannelListByPage1(ByChannel channel, Integer start, Integer offset);
    public List<ByChannel> selectChannelListLevel2();
    public List<ByAd> findAllByAdByPrarentId(int parentId, int limit,String city);
    public Integer selectChannelListCount(Integer positionId, Integer parentId, Integer status);
    public Integer selectChannelListCount1(ByChannel channel);
    public List<ByChannel> selectAllSubChannelList();
    public List<ByChannel> findChannelByParentId(Integer parentId);
    public List<ByChannelKeyword> findChannelKeywordByParentId(Integer parentId);

    public Integer insertNotice(ByNotice byNotice);
    public ByNotice findNotice(Integer id);
    public List<ByNotice> selectNoticeListByPage(Integer userId, Integer noticeType, Integer start, Integer offset);
    public Integer selectNoticeListCount(Integer userId, Integer noticeType);

    public Integer insertAd(ByAd byAd);
    public ByAd findAd(Integer id);
    public Integer deleteAd(Integer id);
    public Integer deleteChannel(Integer id);
    public Integer deleteChannelKeyWord(Integer id);
    public List<ByAd> selectAdListByPage(Integer positionId, Integer parentId, Integer status, Integer start, Integer offset);
    public Integer selectAdListCount(Integer positionId, Integer parentId, Integer status);
    public List<ByAd> selectAdListByPage1(ByAd byAd, Integer start, Integer offset);
    public List<ByAd> findAllByParentId(int parentId,int limit,String city);
    public List<ByAd> findAllByParentId(int parentId);
    public Integer selectAdListCount1(ByAd byAd);

    public Integer insertArticle(ByArticle byArticle);
    public ByArticle findArticle(Integer id);
    public List<ByArticle> selectArticleListByPage(Integer userId, Integer positionId, Integer articleType, Integer start, Integer offset);
    public Integer selectArticleListCount(Integer userId, Integer positionId,Integer articleType);

    public Integer insertComment(ByUserComment byUserComment);
    public ByUserComment findComment(Integer id);
    public List<ByUserComment> selectCommentListByPage(Integer userId, String tableName, String tableId, Integer start, Integer offset);
    public Integer selectCommentListCount(Integer userId, String tableName, String tableId);

    public Integer insertKeyWord(ByChannelKeyword byChannelKeyword);
    public ByChannelKeyword findKeyWord(Integer id);
    public List<ByChannelKeyword> findKeyWordList(List<Integer> ids);
    public List<ByChannelKeyword> selectKeyWordListByPage(Integer positionId, Integer parentId, String name, Integer status, Integer start, Integer offset);
    public List<ByChannelKeyword> selectKeyWordAllList();
    public Integer selectKeyWordListCount(Integer positionId, Integer parentId, String name, Integer status);

    public List<ByChannel> findAllByChannelByLeftList();
    public List<ByChannel> findAllByChannelKeyWorkByLeftList();
    public List<ByChannelKeyword> findAllByChannelKeywordByLeftList();
    public List<ByChannel> findAllByChannelByPositionId(int positionId);
    public List<ByAd> findAllByAdByPositionId(int positionId,int limit,String city);
}
